package com.lab01;


import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Date;

public class Excise03 {
    public static void main(String[] args) throws ParseException {
        Date d = new Date();

        long time = System.currentTimeMillis();
        d.setTime(time);
        System.out.println(d);

        System.out.println("--------------------");

        SimpleDateFormat sdf = new SimpleDateFormat("yyy年MM月dd日 HH:mm:ss");
        String s = sdf.format(d);
        System.out.println(s);

        System.out.println("--------------------");

        String ss = "2023-2-23 10:10:10";
        SimpleDateFormat sdf2 = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
        Date dd = sdf2.parse(ss);
        System.out.println(dd);
    }

}
/*
    Thu Feb 23 22:14:37 CST 2023
        --------------------
        2023年02月23日 22:14:37
        --------------------
        Thu Feb 23 10:10:10 CST 2023
*/


